Apache Hive Essentials by Dayong Du

Apache Hive Essentials by Dayong Du

Author:Dayong Du
Language: eng
Format: epub
Tags: COM021000 - COMPUTERS / Databases / General, COM018000 - COMPUTERS / Data Processing, COM021040 - COMPUTERS / Databases / Data Warehousing
Publisher: Packt Publishing
Published: 2018-06-29T12:49:36+00:00


Here is an example of merging data in HQL:

-- Create another table as merge source

> CREATE TABLE employee_update (

> emp_id int,

> name string,

> start_date date,

> quit_date date,

> quit_flag string

> );

No rows affected (0.127 seconds)

-- Populate data

> INSERT INTO TABLE employee_update VALUES

> (100, 'Michael', '2017-02-01', '2018-01-01', 'Y'), -- People quit

> (102, 'Steven', '2018-01-02', null, 'N'), -- People has start_date update

> (105, 'Lily', '2018-04-01', null, 'N'); -- People newly started

No rows affected (19.832 seconds)



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.